﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;



public partial class Administrator_quanlycacdotruttham : System.Web.UI.Page
{
  

   
    protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
    {
        if (e.Exception != null)
        {
            e.KeepInEditMode = true;
            e.ExceptionHandled = true;
            DisplayMessage(true, "PointBackage" + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][" PointBackage_id"] + " cannot be updated due to invalid data.");
        }
        else
        {
            DisplayMessage(false, " PointBackage" + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][" PointBackage_id"] + " updated");
        }
    }
   

    private void DisplayMessage(bool isError, string text)
    {
        Label label = (isError) ? this.Label1 : this.Label2;
        label.Text = text;
    }
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        //(this.RadGrid1.MasterTableView.AutoGeneratedColumns[0] as GridBoundColumn).ReadOnly = true;
    }

    protected void RadGrid1_ItemInserted(object sender, Telerik.Web.UI.GridInsertedEventArgs e)
    {
        if (e.Exception != null)
        {
            e.ExceptionHandled = true;
            e.KeepInInsertMode = true;
            DisplayMessage(true, "Product cannot be inserted due to invalid data.");
        }
        else
        {
            DisplayMessage(false, "Product inserted");
        }
    }
}